cmake_minimum_required(VERSION 3.10)

project(Question1 LANGUAGES CXX)

find_package(OpenMP REQUIRED)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(SRC_FILES main.cpp)

# 添加可执行目标
add_executable(main ${SRC_FILES})

# 指定包含路径（如果 `grid_io.hpp` 在当前目录，通常不需要额外指定）
include_directories(${CMAKE_SOURCE_DIR})

target_link_libraries(main PUBLIC OpenMP::OpenMP_CXX)

# 编译选项
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
    target_compile_options(main PRIVATE /RTC1 /Od ${OpenMP_CXX_FLAGS})
elseif (CMAKE_BUILD_TYPE STREQUAL "Release")
    target_compile_options(main PRIVATE /O2 ${OpenMP_CXX_FLAGS})
endif()

set_target_properties(main PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

# 添加清理功能
set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM 1)
